package com.esri.core.symbol;

import com.esri.core.internal.util.d;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;

/* loaded from: classes.dex */
public abstract class MarkerSymbol implements Symbol {
    private static final long serialVersionUID = 1;
    float a;
    float b;
    float c;
    float d;
    int e;
    float f;

    public MarkerSymbol(JsonNode jsonNode) {
        this.e = 255;
        this.f = 0.0f;
        if (jsonNode == null) {
            throw new IllegalArgumentException("The JsonNode object is null.");
        }
        this.a = d.a(jsonNode, "xoffset", this.a);
        this.b = d.a(jsonNode, "yoffset", this.b);
        this.c = d.a(jsonNode, "width", this.c);
        this.d = d.a(jsonNode, "height", this.d);
        this.f = d.a(jsonNode, "angle", this.f);
    }

    public MarkerSymbol(MarkerSymbol markerSymbol) {
        this.e = 255;
        this.f = 0.0f;
        if (markerSymbol == null) {
            throw new IllegalArgumentException("The MarkerSymbol object is null.");
        }
        this.f = markerSymbol.f;
        this.d = markerSymbol.d;
        this.c = markerSymbol.c;
        this.a = markerSymbol.a;
        this.b = markerSymbol.b;
    }

    public MarkerSymbol() {
        this.e = 255;
        this.f = 0.0f;
    }

    public float getAngle() {
        return this.f;
    }

    public MarkerSymbol setAngle(float f) {
        this.f = f;
        return this;
    }

    public float getWidth() {
        return this.c;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void setWidth(float f) {
        this.c = f;
    }

    public float getHeight() {
        return this.d;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void setHeight(float f) {
        this.d = f;
    }

    public float getOffsetX() {
        return this.a;
    }

    public MarkerSymbol setOffsetX(float f) {
        this.a = f;
        return this;
    }

    public float getOffsetY() {
        return this.b;
    }

    public MarkerSymbol setOffsetY(float f) {
        this.b = f;
        return this;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void a(JsonGenerator jsonGenerator) throws Exception {
        d.a(jsonGenerator, "xoffset", this.a);
        d.a(jsonGenerator, "yoffset", this.b);
        d.a(jsonGenerator, "width", this.c);
        d.a(jsonGenerator, "height", this.d);
        d.a(jsonGenerator, "angle", this.f);
    }

    public static MarkerSymbol fromJson(String str) throws Exception {
        if (str != null && !str.isEmpty()) {
            JsonNode readValueAsTree = new ObjectMapper().getJsonFactory().createJsonParser(str).readValueAsTree();
            if (str.contains(SimpleMarkerSymbol.TYPE)) {
                return new SimpleMarkerSymbol(readValueAsTree);
            }
            if (str.contains(PictureMarkerSymbol.TYPE)) {
                return new PictureMarkerSymbol(readValueAsTree);
            }
            if (str.contains(TextSymbol.TYPE)) {
                return new TextSymbol(readValueAsTree);
            }
        }
        return null;
    }

    public int hashCode() {
        return ((((((((Float.floatToIntBits(this.d) + 31) * 31) + Float.floatToIntBits(this.a)) * 31) + Float.floatToIntBits(this.b)) * 31) + Float.floatToIntBits(this.c)) * 31) + Float.floatToIntBits(this.f);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            MarkerSymbol markerSymbol = (MarkerSymbol) obj;
            return Float.floatToIntBits(this.d) == Float.floatToIntBits(markerSymbol.d) && Float.floatToIntBits(this.a) == Float.floatToIntBits(markerSymbol.a) && Float.floatToIntBits(this.b) == Float.floatToIntBits(markerSymbol.b) && Float.floatToIntBits(this.c) == Float.floatToIntBits(markerSymbol.c) && Float.floatToIntBits(this.f) == Float.floatToIntBits(markerSymbol.f);
        }
        return false;
    }
}
